<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('添加成员')" />
    <th:block th:include="include :: select2-css" />
</head>
<body>
<div class="main-content">
    <form id="form-user-add" class="form-horizontal">
        <input type="hidden" id="prjgroupId" name="prjgroupId" >
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">项目组名称：</label>
                    <div class="col-sm-8">
                        <input name="userName" class="form-control" type="text" disabled th:value="${item.prjgroupName}">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">负责人：</label>
                    <div class="col-sm-8">
                        <input name="loginName" class="form-control" type="text" disabled th:value="${item.leader}" >
                    </div>
                </div>
            </div>


        </div>

        <h4 class="form-header h4">参与项目成员</h4>

        <div class="row">
            <div class="col-sm-12">
                <div class="col-sm-12 select-table table-striped">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/itemQuery";
    var ItemDetailss = [[${prjDetail}]]
    console.log(ItemDetailss)


    $(function a() {
        var options = {
            data: ItemDetailss,
            sidePagination: "client",
            sortName: "roleSort",
            showSearch: false,
            showRefresh: false,
            clickToSelect: true,//是否启用点击选中行
            showToggle: false,
            showColumns: false,
            clickToSelect: true,
            maintainSelected: true,
            columns: [
                {
                    field: 'name',
                    title: '员工姓名',
                    sortable: true
                },
                {
                    field: 'empNo',
                    title: '员工编号'
                },
                {
                    field: 'deptName',
                    title: '部门'
                },
                {
                    field: 'mobile',
                    title: '手机'
                },
                {
                    title: '员工状态',
                    field: 'staffStatus',
                },{
                    title: '工作计划',
                    field: 'todayPlan',
                },{
                    title: '待完成工作',
                    field: 'notDoWork'
                }
                ]
        };
        $.table.init(options);
    });



    /* 添加角色-提交 */
    function submitHandler(index, layero){
        var rows = $.table.selectFirstColumns();
        var data = { "prjgroupId": $("#prjgroupId").val(), "employeeIds": rows.join() };
        $.operate.save(prefix + "/insertMember", data);
    }

</script>
</body>
</html>